import http from "@/api";
import qs from "qs";
//获取升级如人员
export const getUpgradeUserList = () => {
  return http.post(`pages/updatelevel!findAllLevels.action`);
};
//删除规则
export const delRule = params => {
  return http.post("/pages/callBusinessRule!delete.action", params);
};
//添加规则前验证是否存在
export const checkRuleName = params => {
  return http.post("/pages/callBusinessRule!existRuleName.action", qs.stringify(params));
};
//添加请求规则
export const addBusinessRule = params => {
  return http.post("/pages/callBusinessRuleSet!save.action", qs.stringify(params));
};
//编辑请求规则数据
export const getEditReqestRuleData = params => {
  return http.post("/pages/callBusinessRuleSet!findRuleNewPage.action", qs.stringify(params));
};
//保存编辑请求规则
export const saveUpdateRule = params => {
  return http.post("/pages/callBusinessRuleSet!merge.action", qs.stringify(params));
};
//邮件转请求规则列表
export const emailTransferRequestRulesList = params => {
  return http.post(
    "/pages/callBusinessRule!findRules.action?rulePackageNo=2",
    qs.stringify({
      page: params.pageNum,
      rows: params.pageSize,
      sidx: "ruleNo",
      sord: "desc",
      "ruleQueryDTO.description": params["ruleQueryDTO.description"],
      "ruleQueryDTO.ruleName": params["ruleQueryDTO.ruleName"]
    })
  );
};
